@extends('adminDialog')

@section('content')
    <form action="{{url('admin/areas/distupdate/'.$model->id)}}" method="POST" class="J_ajaxForm">
        <input type="hidden" name="_token" value="{{ csrf_token() }}">
        <div class="pop_cont pop_table">
            <table width="100%">
                <tbody>
                <tr>
                    <th><label for="prov_id">所属省份 <span class="red">*</span></label></th>
                    <td>
                        <select name="prov_id" id="prov_id">
                            <option value="">请选择</option>
                            @foreach($provinces as $pro)
                                <option @if ($pro->id == $model->prov_id) selected="selected" @endif value="{{$pro->id}}">{{$pro->name}}</option>
                            @endforeach
                        </select>
                    </td>
                </tr>
                <tr>
                    <th><label for="city_id">所属城市 <span class="red">*</span></label></th>
                    <td>
                        <select name="city_id" id="city_id">
                            <option value="">请选择</option>
                            @foreach($cities as $pro)
                                <option @if ($pro->id == $model->city_id) selected="selected" @endif value="{{$pro->id}}">{{$pro->name}}</option>
                            @endforeach
                        </select>
                    </td>
                </tr>
                <tr>
                    <th><label for="area_id">所属地区 <span class="red">*</span></label></th>
                    <td>
                        <select name="area_id" id="area_id">
                            <option value="">请选择</option>
                            @foreach($areas as $pro)
                                <option @if ($pro->id == $model->area_id) selected="selected" @endif value="{{$pro->id}}">{{$pro->name}}</option>
                            @endforeach
                        </select>
                    </td>
                </tr>
                <tr>
                    <th><label for="name">商圈名称 <span class="red">*</span></label></th>
                    <td>
                        <input type="text" name="name" id="name" class="input length_2" value="{{$model->name}}"/>
                    </td>
                </tr>
                <tr>
                    <th><label for="is_host">是否热门商圈</label></th>
                    <td>
                        <input type="radio" @if($model->is_hot) checked="checked" @endif name="is_hot" value="1" id="is_hot_1"/><label for="is_hot_1">是</label>
                        <input type="radio" @if(!$model->is_hot) checked="checked" @endif name="is_hot" value="0" id="is_hot_2"/><label for="is_hot_2">否</label>
                    </td>
                </tr>

                </tbody>
            </table>
        </div>

        <div class="pop_bottom cc">
            <button type="reset" class="btn fr" id="J_dialog_close">取消</button>
            <button type="submit" class="btn btn_submit J_ajax_submit_btn fr mr10" id="J_dialog_close">提交</button>
        </div>
    </form>
@stop

@section('style')
    <style>
        .body_none {width: 300px;}
        .uploadifyQueue {display: none;}
    </style>
@stop

@section('js')
    @parent
    <script src="{{asset('/js/admin/admin.js')}}"></script>
    <script>
        $('#prov_id').on('change', function () {
            reloadOptions($(this).val(), $('#city_id'), 'Area', '', '', $('#area_id'));
        });

        $('#city_id').on('change', function () {
            reloadOptions($(this).val(), $('#area_id'), 'Area');
        });
    </script>
@endsection